<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // document.write("来旅梦，去名企");
        // {}用于创建对象 key:value
        // 男主角
        // var let const区别
        // 未定义？undefined 值未定义，在内存的分配没有确定
        let num;
        console.log(num);
        num=1;
        let a=null;
        let ljj={
        hobbies:["羽毛球","干饭"],
        name:'李家君',
        sex:'男',
        hometown:'丰城',
        college:'东华理工大学',
        room:'903',
        isSingle:true,
        age:18,
        yanzhi:80,
        sendFlower(target){
            target.receiveFlower(this)
        }
        }
        // 送花
        //女主角 
        let xh={
            name:'小红',
            xq:50,
            receiveFlower(sender){
            // if(sender.yanzhi<90){
            // console.log('不好意思，你是个好人')
            //    }
            //  else{
            // console.log('万达走一波')}
            if(this.xq<80){
                console.log('gun...')
            }else{
                console.log('万达走一波');
            }
             console.log(this.name+'收到了'+sender.name+'送的花')
            }
           
        }
        let xm={
            name:'小美',
            hometown:'丰城',
            receiveFlower(sender){
                // if(sender.name=='李家君'){
                //     console.log('君哥，让我们在一起吧...')
                // }else{
                //     xh.receiveFlower(sender);
                // }
                // xh.xq=90;
           setTimeout(()=>{
           xh.xq=90,
           xh.receiveFlower(sender)
        },3000) /*定时器 3s*/
                
                xh.receiveFlower(sender)
            }
        }
    </script>
</body>
</html>